<template>
    <div class="bigbox">
        <ETable :isSearch="false" :columns="columns" :delelte="delCompany" :loadData="getCompanys" :isPage="true" :pageSize="[10,20,30]" >


          <template #buttons>
            
              <el-button type="success" @click="router.push('/logistics/add')" >创建采购申请</el-button>
           
            
          </template>

          <template #operation="{row , del}">
            <el-button type="danger" @click="del(row.id)">删除</el-button>
            <el-button type="primary" >编辑</el-button>
          </template>
          
        </ETable>
        
        
    </div>
</template>

<script setup lang="ts">

import  {delCompany, getCompanys } from '../../apis/purchase/purchase';
import ETable, { type ColumnType } from '../../components/ETable.vue';
import { reactive } from 'vue';
import router from '@/router';




const columns= reactive<ColumnType[]>([
  {
    prop: 'id',
    label: '序号',
    width: '90',
  },
  {
    prop: 'addTime',
    label: '创建时间',
    width: '200',
  },
  {
    prop: 'addAccountName',
    label: '申请人',
    width: '',
  },
  {
    prop: 'counts',
    label: '品种',
    width: '',
  },
  {
    prop: 'purchasePrice',
    label: '实际采购成本',
    width: '',
  },
  {
    prop: 'state',
    label: '状态',
    width: '',
  },
  {
    prop: 'operation',
    label: '操作',
    slot: true,
    width: '',
  },
])
</script>

<style scoped>

</style>